# #/usr/local/bin/python3   指定解释器
# import hashlib            #导入模块
# from sys import argv
# m = hashlib.md5()         #全局变量
# def check_md5(fname):
#     '主程序读，更新，'
#     with open(fname,'rb') as f:
#         while 1:
#             data = f.read(4096)
#             if not data:
#                 break
#             m.update(data)
#     return  m.hexdigest()
# if __name__ == '__main__':
#     result=check_md5(argv[1])  #位置变量
#     print(result)              #结果返还打印
#/usr/local/bin/python3
# from sys import argv
# import hashlib
# m = hashlib.md5()
# def check_out(fname):
#     '用于读，更新，返回'
#     while True:
#         with open(fname,'rb') as f:
#             data = f.read(4096)
#             if not data:
#                 break
#             m.update(data)
#         return m.hexdigest()
# if __name__ == '__main__':
#     result= check_out(argv[1])
#     print(result)


#/usr/local/bin/python3
import hashlib
from sys import argv
m= hashlib.md5()
def check_md5(fname):
    while True:
        with open(fname,'rb') as f:
            data = f.read(4096)
            if not data:
                break
            m.update(data)
        return m.hexdigest()
if __name__ == '__main__':
    result=check_md5(argv[1])
    print(result)















































